refactored / cleaned up parser module