Moved logout logic to common activity