Agreed - this could probably be abstracted to a small prototype method.