This needs to get into some sort of middleware or something.