Rework createIcon function in order to fix #17