Updated to remove some resharper warnings