refactor utility methods to statics for use in testing