Cleanup

Slightly cleaned up the code and allowed for future modularization.