this function should be moved to sandbox ("rules")