Instead of using notify member functions, just use functors.