store to sqlite db and remove old js code