fine tune alog and move data logic to node server