moved imports into functions