Refactor metadata assignment in `parse` method

Prettier metadata assignment. A bit cleaner test.