Refactoring of some exercises.