Refactor vectorized arithmetical operations