Moved index methods into sperate file.