Clean up and a little speed up