Refactored the code for properties view and used it in viewUsers