Refactor Complex JSON Hash into Separate Method