make use of JS prototype

make use of JS prototype and define private functions using “-“