Refactor 'pow' again.