Code cleanup/tweaks