tuning up...
Refactored to appstates