optimization & documentation