refactor index stuff code and re-layout index stuff page