NIP. refactor to generate