implemented signOn and signOut mechanism
dome some refactoring