Refactor some conditionals to one-line form