refactoring javascripts out into more atomic files