code re-factoring