JS and CSS refactor