Slight refactoring of the previous commit