moving functionality to helper