Refactoring code and adding local jquery files