Optimized a few things from the previous commit