Understanding registry pattern