Partial DRY refactor