view parser.js refactored