refacor helper class