code cleaning, simplified vector transformations