Refactor divisible method