After some intense refactoring