I just try to make this code smart