some code improvements, no logic