refactored code and refresh data upon adding/deleting users