define state manager