Major refactoring frenzy