Move this method to base Generator class.