refactor web code gen