small optimizations
merge small optimizations