Seperated the StateObject class as it is used by more than one class