Finished refactoring of old stuff.