refactor sql storage to abstract task storage