small refactor index