test refactor with callback