Tightened up main class and added controller