Refactor parser and add defines for cv classes to make cleaner