merge constructor and authenticate