More Cleanup

Some refactor in index and main. Increased speed on main screen.
Selective version and reduced code size.