cleaning + improve complexity