refactored .states