total DRY refactor