refactoring final