Factored out zk helper for cleaner code