Minor optimizations for speed