refactor state behavior WIP