refactoring - moving registry related stuff into separate class