refactor json broker