tweak and clean things up a bit (cc @jonahss)