Do some small optimizations