Code refactor and CSS