refactored toggle class to colorfy method