Simplified getFilename method