An approach to pointwise ergodic theorems