Keep method visibility

The current implementation makes protected or private methods to be public.
This change makes Mem to keep method visibility.