Removing dependency on Application.Current.