wrap calls into function