moving non-generic code out of the Web controller