make sure we don't do more work than necessary