Removed code duplication of xExists functions

Sorry this took a few days :x hope it's helpful!