optional commands with before and after