batching engine works need to replace some literals with internal vars