Readd some optimizations