Refactored getStates for client