moved utility methods to a helper file