Calculate amount refactoring