refactoring and increasing coverage
increasing coverage
increasing coverage and found a bug while doing so