refactory names and add json pretty print