cleaning up the generics by leveraging type erasure and casting (yuck)