Created a state class and a service repository class