Refactory do exercicio 9.2