Shifting parsing logic into separate method