moved import syntax logic out of parser