refactor frame calculations to `rectForIndexBarFrame` method. fix issue with centering text when not contained in a table view