refactoring of code, added ZK based offset manager