Pointer to reference

- Replaced a lot of pointers with references in order to prevent memory
leaks.
- Access speed of frequently used entities optimized