move import out of function while maintaining behaviour