clean resize init function