Just a bunch more refactoring...