Credentials refactor