start refactor js + start editing sqlite queries