Just a whole lot'a refactorings and cleanup