make minor adjustments, clean up code