Refactor user model, fix #5