added general-use update function in database model and refactored user_model to use it