Began refactoring code into modules