Finally done refactoring