re-write parser using resource; easier to re-use