Refactored so that only running instances are returned.