refactor styleClass code to use helper class