delete extra function to make code looks easier
add comment and delete redundancies code to make source simpler