Refactor some testes