moving methods from json into java