refining code

refining code