Rewrites class to store code as a private attribute