optimizations for detecting body