Refactoring to mixins