scope - memory fixes, removed an unused struct