begin refactoring for TS1.0 - everything is broken