restructure and cleanip