refactoring - extracted function builder