finalizing refactoring