Synthesis of organic materials for optoelectronic applications