Better way of ignoring directories