Refactorized authenticate and authenticated methods of Mapper class to avoid repeated code