cleaned autogenerated files
moved code into a local scope and introduced some local variable declerations