Removed code duplication of xExists functions