add make callback, refactor function calling