Cleaned up app generator
Refactored state generator