refactoring do calculo