improve comments and code clarity