refactoring: Code duplication eliminated