improve generation of RESP messages