Working JSON-based approach