refactoring arithmetic