Code to create SpringXDTemplate - along with catch block - could be in a utility method to reduce duplication.