factor out unless for readability