clean

remove unused declaration & merge 2 function into 1