Melt the chocolate using double boiler and add the butter as well to it so that it melts along with the chocolate. Wait for about a minute and then add the sugar and whisk it.
Then slowly add the eggs one by one while whisking it, the batter should be become shiny and pasty. Finally add the vanilla extract and fold in the flour into it.
Distribute them into the muffin tray lined with muffin cups. Bake them at 165 degree centigrade in a preheated oven for about 20 minutes or till they are done but gooey enough.
The butter should be at room temperature for this. Whisk it. I have an electric beater so took about 2 minutes. Now add the icing sugar and whisk it till its mixed and fluffy.
Beforehand, melt the chocolate using double boiler and leave it to cool for about 2 minutes. Then fold this chocolate into the butter icing and whisk again till required consistency is obtained. Pipe the icing on the cooled cupcakes.