Moved a bit of the stuff to its own header