added factory for user and user_hash