misc code cleanup/updates