[view_shared_dir] clean up the code