The current code is very brittle, and difficult to extend. Refactor it so that other developers can easily create custom appenders.