Cleaned and optimized a bit.