remove unused import
add begin and end patterns
new generator