Few code fixes
Add factory for users