Refactor model test