Refactoring to helper