refactor cap5 e 6