Adding and clean up of references.