changed secret to use topic in HMAC & refactoring
added documentation