Refactored and fixed bug in FilePreProcessor