refactored controllers and added styles