restructure a bit for the new package scheme
add generate id util func
fix imports