Refactoring cmdlets to a base