refactoring validation on calculations