restructure callback