refactor string and dict(not finished)