refactor ContractController and update ParserTest