some small refactorings to make the Parse method more succinct