Made some style changes and optimized some stuff