WIP: Major refactoring that, of course, broke everything