DRY + bugfix