little improvements to common functions