created module to house some methods used in two places