add re and remove un-used variable