native memory flipper: refactoring

Signed-off-by: Samuel Casa <samuelcasa9@gmail.com>