moved index to public, modularized