Refactor CSS and JS accordingly