refactored parsing to be more specific