moving xpreq code to own directory