Fine-tune layer coloring, clean-up code