removed setTab method
clean up and some refactoring
refactoring and comments