Final commit before major code refactoring (I think I said that before...)