refactoring of input, match and json output