Moved some boiler from the original repo here.