removing all non used reference