elimination of redundant if statements in isInternal() and isExternal()