Remove named toObject function