Reorganise AddPartialClass and checkout item before updating main file