refactor jsonbranch factory