refactor states