small conditional refactor