Remove shadowing and improve code base.