Cleanup and fix key iterations (config setting)

Update documentation and general code cleanup