Broke a long parsing function into smaller parsing functions