refactored FileParser