Refactor decolor function