Factor out parsing
Cleanup records