Stef Extracted user state into UserRepository. Introduced Event type