Simplify markup and refactor CSS and JS