refactoring main js file
adding source files