Finished refactoring for now. Compiling.