smallish code cleanup