DRY some code.