Refacto auth