Split authentication into separate module