move imports before each function