code refinement in FileParser class