defer complication logic to a function