Memory improvement
almost finished for the next update