refactored user_lib