setup useEntity in FriendBase's constructor; extend FriendBase in Index as well.
compact code.
use setNamespace for entity to simplify the code.