minor fixes to improve code clarity