Allow users to define custom before/after callbacks (#3)