code re-design