Changed architecture to make webhook handling more extensible.