Clean up, work in progress rewrite.