refactored hash and subscribtion api