Fix bugs in FileRecordFactory.java.
Start to refactory codes.