Some structural improvements

Various improvements