Done some optimizations