Refactor CSS and JS