Refactor schema listener generation