memory tweak
clean and document