Update: refactor generator