Did some optimizaton