Finalizes refactoring