a few code inprovements, no functional differences