COOPR-550: improve it and use gson with codecs