refactor using an invocation