cleanup code for models
added controller for UI