refactor helper class