Polymorphic readFile() function