Refactoring into functional-delegate style