fix method body generation for methods with parameters
add imports for local variables