transforming public methods into private methods