add class field and reformate main