Removed pub/sub stuff. Moved scope definition to type constructor for more efficient initialization.