split parseLine into its own function