Style and some index refactoring