refactor to smaller methods
match json package name to match what's defined