refactored parsestat class to reduce duplication