refactoring: extract function, rename option