Separate concerns into different files.

Separating things out helped me understand the code better and makes the code easier to reuse and modify.