Cleanup (fix names and infer generics)
Fix the rest of the warnings, and remove redundant comments