Added some generics pedantry that may not be worth it, but hey