Refactored into a static class

moved code that needed to be reused in multiple classes out into a
static class.