refact e testes