Refactor user update logic function
Tweak resource query