RecordParser refactor and test cases