Simplify dir check