improve import orders and fix some issues