cleaned up, refactored  and commented lines 50 - 150 in users.js