Clean up code

Lumping code together. Trying to be a little bit more clever.