pull wrapper function out