Improve performance using private memory
Refactor matrix_mul.cpp for cleaner code and common interface