code re factor.