Refactor css and javascript