refactored CSS and JS