use cheaper data structure for main_*
main_cat and main_dev
Merge pull request #57 from michaelfung/master

use cheaper data structure for main_*