misc. code cleanup