Refactoring shelves/index. Some test fixed.