significant rewrites to satisfy new archteture