Refactored json format with helper method