Refactor generator
Remove debug line
Fix and refactor @import handler