Refactoring some generators