optimizations: batching and safe shortcuts