refactor out common state init check
add all target in Makefile.in
replace & with &&, apply new formatter