Clean ups, improvements, mem tracking needs testing