Big refactor to add Generics for all of the main features

Change-Id: I73af76164810c23542199774f9d762eae397d317