code cleanup
trying to improve remove-allocated