optimize code for smoother render and efficiency