Enhance main code