Refactor so that check does not alter state