more sophisticated imports parsing