[refactor] cleand up the median and average function
[feat] divieded averge and median test