move stuff out of test and into xosHelper.js for better code reuse