moved import to function