warnings and unnecessary assertions removed