Made logout view more flexible