[feature/cliff] optimize code