update color and cleanup code