Refactoring: isOdd as a separate method