second pass: general code clean up