improve performance, reduce memory cost