New utils.psm1 method and refactoring