Finished refactoring for now.