Refactor test cases to use models to prevent mistakes