improving register functionality