refactor base class a little; not 100% working just yet