Before and After tasks for required tasks recursively