Cleanup global var

Removed remaining three global vars
Added tab location settings