Refactoring code for readability.

 * Removed single line if blocks
 * Unified styling across files