continued refactor and fixed default tab