I'm so happy to see all this code out of the template! Finally we'll be able to unit test it...