Moved index validation to separate method