Move local variables into objects or smaller blocks

I hope this will ease the memory management task.
Move local variables into objects or smaller blocks (AutoarCreate)