refactor PAMath calls