some little optimizations