refactoring updateColors.js