Adding factory method for element generators