removed unused references and handled warnings