Moved hacky code into a partial.