update old code for static batching