move line parsing into separate function for future use