steam-json: refactored for better control flow and readability