change from state to object