miscellaneous code cleanup