cleanup; remove old beta code; optimize caching