refactor for management of wxRegKey