Extracting authentication to separate module.