Major separation of controller and input js files