Refactor the CSS and add various small fixes