merged parseFirstLine and parseRemainingLines into createMap method