Heavy refactoring, because refactoring is fun!