encapsulate auth