Added BEFORE_EACH and AFTER_EACH methods
Merged