refactor to state over logic