Oh, mother of refactoring..