Did even more even more refactoring, but my code still smells...