Improved constructor for import handling