replaced duplicate code for updating user level set with function call