Cleanup Generics and move out some common code