changed fileManager a bit to make it more abstract