In a workshop where security doors are manufactured, Pan and his co-workers are busy inspecting the quality of the products.
"It feels so good to keep myself busy," said Pan, 33, who earns nearly 4,000 yuan ($570) a month.
Pan, not his real name, from Zhenxiong county in Yunnan province, used to be addicted to drugs and spent all his family's savings. In 2016, the family of six, including four children, was registered as an impoverished household.
Pan underwent job training organized by the government and found employment at the security door factory in Jinhua, Zhejiang province, this year. His first wife, who left him when he was in rehab, is now with him.
As part of national efforts to eradicate absolute poverty by the end of this year, the Yunnan provincial government has combined the work of drug control and poverty alleviation, organizing training for those who have completed rehab to help them gain employment.
Yunnan is on the front line of China's battle against drug abuse as it borders the Golden Triangle, known for rampant drug production and trafficking.
Figures show 31,900 people identified as being involved with illegal drugs in Yunnan in 2018 were classified as poor.
Lured by his friends, Pan started taking heroin at the age of 15. "I was frightened to hear a police siren. Relatives and friends were all reluctant to see me," he said.
He married twice, but both wives divorced him, leaving four children at home under his mother's care.
When he was put into a drug rehabilitation center for the third time, officials working to alleviate poverty regularly visited his family. With some financial assistance from the government, the family had a new house built and Pan's mother was given a minimum living allowance.
"Their care for my family became a strong inspiration for me to reject my former life and make a new start," he said.
In rehab, Pan applied for skills training, such as making earphones, clothes hangers and electronics. "By working, I gradually forgot about drugs," Pan said.
Yang Hongbin, an official with the provincial narcotics control office, said more than 90 percent of drug addicts in rural areas are young and middle-aged males. Each user of illegal drugs spends at least 36,000 yuan a year, equivalent to the annual income of a family of four.
Illnesses caused by illegal drug use and relapse into abuse made it harder to shake off poverty, Yang said.
Chen Xin, a narcotics control officer with the provincial department of justice, said for drug abusers too ill to work, the government provided a 300 yuan monthly allowance to pay basic living expenses.
Those who are looking for a job or trying to start a business will receive government help, Chen said.
The government will train them in job skills such as gardening and motorcycle repair, and also recommend them for employment.
After quitting drugs, Zheng, not his real name, from Longling county in Yunnan, was given help to shake off poverty. Encouraged by the local government, Zheng started breeding pigs three years ago.
He and his wife earned over 150,000 yuan last year after selling 60 pigs.
"I felt so desperate on returning home after rehab. Now with a stable income, I feel very much at ease," he said, adding that he plans to expand his pig farm this year.
Statistics show the central government has initiated targeted poverty alleviation for 231,000 impoverished people with drug abuse problems across the country. By March, 84 percent of them had been lifted out of poverty.
Li Yirong, an official with the provincial narcotics control office, said narcotics control and poverty alleviation are common problems faced around the world, and that China's practices might help other countries.
"Although the number of impoverished people involved in drugs is relatively small, it is important to lift them out of poverty," Li said.