Added signout and refactored