moved method to helper class