moved methods into a helper file