miscellaneous function tweaks