moved functionality to helper methods