Minor code simplification suggested by Duncan