Improve the code to update a teaching
DRY refactory