Revise this code and generate the whole latex code again in a way that the created chart fits inside a slide and the boxes don't overlap with each other. 

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,calc}

\begin{document}

\begin{frame}[t]
\tikzstyle{block} = [rectangle, draw, text width=4.5cm, text centered, minimum height=0.6cm, font=\small]
\tikzstyle{smallblock} = [rectangle, draw, text width=2.8cm, text centered, minimum height=0.6cm, font=\scriptsize]
\tikzstyle{tinyblock} = [rectangle, draw, text width=2.2cm, text centered, minimum height=0.6cm, font=\scriptsize]
\tikzstyle{line} = [draw, -latex']

\begin{tikzpicture}[node distance=0.4cm, scale=0.58, transform shape]
    % Main BYOD Policy
    \node [block] (byod) {BYOD Policy};
    
    % Operational Layer
    \node [smallblock, below=0.4cm of byod] (onboard) {On-boarding Policy};
    \node [tinyblock, below=0.3cm of onboard] (user) {User Account Registration};
    \node [tinyblock, right=0.2cm of user] (device) {Device Registration};
    \node [tinyblock, right=0.2cm of device] (agreement) {End-user/Service Agreement};
    
    \node [smallblock, below=0.8cm of onboard] (ident) {Identification \& Access Control Policy};
    \node [tinyblock, below=0.3cm of ident] (pass) {Password};
    \node [tinyblock, right=0.2cm of pass] (auth) {Authentication};
    \node [tinyblock, right=0.2cm of auth] (author) {Authorisation};
    \node [tinyblock, right=0.2cm of author] (account) {Accounting};
    \node [tinyblock, right=0.2cm of account] (network) {Network Segmentation \& Segregation};
    
    % Tactical Layer
    \node [smallblock, below=0.8cm of ident] (comm) {Communication Policy};
    \node [tinyblock, below=0.3cm of comm] (dataprot) {Data Protection};
    \node [tinyblock, below=0.3cm of dataprot] (encrypt) {Encryption};
    \node [tinyblock, right=0.2cm of encrypt] (vpn) {Virtual Private Network};
    \node [tinyblock, right=0.2cm of vpn] (wipe) {Data Wiping};
    \node [tinyblock, right=0.2cm of wipe] (backup) {Data Backup};
    \node [tinyblock, right=0.2cm of backup] (lock) {Device Lockdown};
    
    \node [smallblock, below=1.2cm of comm] (app) {Application Control Policy};
    \node [tinyblock, below=0.3cm of app] (trusted) {Trusted \& Verified Apps};
    \node [tinyblock, right=0.2cm of trusted] (licensed) {Licensed \& Curated App Stores};
    \node [tinyblock, right=0.2cm of licensed] (blacklist) {Blacklisting \& Whitelisting Apps};
    \node [tinyblock, right=0.2cm of blacklist] (contain) {Containerisation};
    \node [tinyblock, right=0.2cm of contain] (virtual) {Virtualisation};
    
    % Strategic Layer
    \node [smallblock, below=0.8cm of app] (risk) {Risk Control Policy};
    \node [tinyblock, below=0.3cm of risk] (malware) {Malware Prevention};
    \node [tinyblock, right=0.2cm of malware] (intrusion) {Intrusion Detection Prevention};
    \node [tinyblock, right=0.2cm of intrusion] (audit) {Auditing};
    \node [tinyblock, right=0.2cm of audit] (aware) {Awareness \& Training Program};
    
    \node [tinyblock, below=0.3cm of malware] (anti) {Anti-virus/Anti-malware Program};
    \node [tinyblock, below=0.3cm of intrusion] (firewall) {Firewall System};
    \node [tinyblock, below=0.3cm of aware] (workshop) {Workshops};
    \node [tinyblock, below=0.3cm of workshop] (cbt) {Computer-based Training};
    \node [tinyblock, right=0.2cm of cbt] (ibt) {Instructor-based Training};
    
    \node [smallblock, below=1.5cm of risk] (comply) {Compliance Policy};
    \node [tinyblock, below=0.3cm of comply] (security) {Security \& Privacy Principles/Laws};
    \node [tinyblock, right=0.2cm of security] (privacy) {Employee Privacy Considerations};
    
    \node [smallblock, below=0.8cm of comply] (maint) {Maintenance Policy};
    \node [tinyblock, below=0.3cm of maint] (update) {Internal and External Systems/Devices Update};
    \node [tinyblock, right=0.2cm of update] (review) {Policy Review \& Update};
    
    % Add connection lines
    \foreach \x in {onboard,ident,comm,app,risk,comply,maint}
        \draw [line] (byod) -- (\x);
        
    \foreach \x in {user,device,agreement}
        \draw [line] (onboard) -- (\x);
        
    \foreach \x in {pass,auth,author,account,network}
        \draw [line] (ident) -- (\x);
        
    \draw [line] (comm) -- (dataprot);
    \foreach \x in {encrypt,vpn,wipe,backup,lock}
        \draw [line] (dataprot) -- (\x);
        
    \foreach \x in {trusted,licensed,blacklist,contain,virtual}
        \draw [line] (app) -- (\x);
        
    \foreach \x in {malware,intrusion,audit,aware}
        \draw [line] (risk) -- (\x);
        
    \draw [line] (malware) -- (anti);
    \draw [line] (intrusion) -- (firewall);
    \draw [line] (aware) -- (workshop);
    \draw [line] (workshop) -- (cbt);
    \draw [line] (workshop) -- (ibt);
    
    \foreach \x in {security,privacy}
        \draw [line] (comply) -- (\x);
        
    \foreach \x in {update,review}
        \draw [line] (maint) -- (\x);
        
    % Add layer labels
    \node [left=0.2cm of ident] {\rotatebox{90}{Operational Layer}};
    \node [left=0.2cm of app] {\rotatebox{90}{Tactical Layer}};
    \node [left=0.2cm of maint] {\rotatebox{90}{Strategic Layer}};
\end{tikzpicture}
\end{frame}

\end{document}