With these callbacks, simple refactorings should be quite easy. It is a starting point and can be extended/improved in many ways.