CSS
Cleanup and conditionals

Improved readability of code and added some conditionals to try to
minimize the chances of error