refactored controllers into seperate javascript files