Abstracted parsing logic