more robust approach to callback API