refactored _parse_stages()