remove raw pointers

more often than not, pointers lead to unexpected behavior, so better use them safely.