Layout and color refinement