inheritance fixes and some re-organization