Remove duplicate code passages from RGB conversion