Refactors diagonal indexes method