Add tiny refactoring: Use unless to raise Exception