refactor LR with SAG