reduce code duplication
streamline math operations