code cleanup for mark&sweep GC
made some tests green