helper function introduced, separated tests