removed unnecessary if-statement
updated annotation for userRepository
refactored code