move state to separate module