refactored controller & views