index refact