initial refactor to support identity extensibility