tabs fix and javascript restructure
merge