code re organize