cleanup: use additional param in favor of flag variable