get rid of ref stuff and fix annotation creation