refactor the code
add proto