Refactor js and css