changing auth method, improve modularization