Implementing all states through structs and moving the logic