improve generator