add indexs and refactor bootstrap