Clean-up

- Shortened some code
* Changed some simpler if statements to ternary    expressions