refactored controller & checkstyled controller