clean up the base code