mayor refactoring of all the things.