UserDAO: use constructor to eliminate redundant code.

Closed #97.