clean up
probably for the old API...needs a rewrite