Factor out set_completion_proc method