more code cleanup, thx to CG