Refactored methods to add isdivisibleby method