Tidy up curves and code