reorg

Re-organize the index file to properly use global php file