removed global references, switched from named to anonymous declare(...)