remove redundant generic type specifications
removed some old unchecked assignments and odd iteration