support for back button use plus refactoring