code re-factor