bug fix: updated record maintanance
code optimization
format and get rid of unsued code
Chk in for sync