rainbowify and optimizations