UserRepository: reorganised code layout.