cleaned and optimized