Added following functionality in lib/users and elsewhere