refactroing: factories, change_state_btn, some test, types on model, etc