improved garbage collection
code formatting