Some refactoring and CSS changes