Added view count for dir shared link and clean code