refactor type and var declare part