Moving common functions in preparation for colors centralization.