Refactoring authentication; new local settings