Refactor code & Add select tab UI