Refactored spec/parser.php