Remove unused methods.
Added "remove generated" functionality.