clean up and fixed some inheritance issues