Clean up, prepare to use vendor and remove duplicated functionality.