getting rid of separate execute-apply function