further improvement to Main