extract json helper method