Tidy provider code