Separate parts of Parser into new getNextFrame function.