initial commit of generic refactor

**DO NOT MERGE**

I just need a review