fix lots of references and todos