refactor state to be more object oriented
Refactor state to be more object oriented