Refactored and secured Teams and Users methods