some light refactoring of states and model usage