refactoring twabase and twaobject