functions: small cleanups