commands are more or less small classes. You should use there some free list or allocator.