refactored the header file and parser