Move field generation code to server.