code cleanup, coverage improvement