minor adjustments and code cleanup