Making extend() supporting multiple objects