Refactoring the css and js