[Correcting] Refactoring the code in Coach.php