simplify / style-tweak conditionals in utils