Improved naming for generic parameters
Simplified and cleaned up some code