refactoring finish