Moving functions to namespaced style
Unnecessary comma separation replaced
More obvious variable name
Refactor of the rgb conversion
Add helper function to remove duplicate code