cleaner, faster implementation of the files status method