I'm opening this just as a reference so it doesn't get lost, I don't think it's quite ready to be merged