Refactoring of a bunch of stuff...