refactoring doRegister method to use UserDao.