Improved weak callback API.