Code improovements