some cleanup and new cli flags
some cleanup and cli
new key func