I am trying to use nodes to draw a simple relation in two figures. Basically what I want looks like this:

How can I do that using tikz? The two relationships should be next to each other. I think if it used subfigures then it would be even better. Any ideas?
EDIT: This is what I have so far:
\documentclass{article}
\usepackage{tikz}
\usepackage{subcaption}
\usetikzlibrary{positioning,arrows}
\tikzset{
block/.style={
draw,
rectangle,
minimum height=1.5cm,
minimum width=3cm, align=center
},
line/.style={->,>=latex'}
}
\begin{document}
\begin{figure}[htbp]
\begin{subfigure}{.5\textwidth}
\centering
\begin{tikzpicture}
\node[block] (a) {Text 1};
\node[block, right = 0.5cm of a] (b) {Text 5};
\draw[line] (a.east) |- (b.west);
\end{tikzpicture}
\caption{Text}
\label{fig:myfirstsubfig}
\end{subfigure}
\begin{subfigure}{.5\textwidth}
\centering
\begin{tikzpicture}
\node[block] (a) {Text 1};
\node[block, above right = 0.2cm and 0.5cm of a] (b) {Text 3};
\node[block, below right = 0.2cm and 0.5cm of b] (c) {Text 5};
\draw[line] (a.north) |- (b.west);
\draw[line] (b.east) -| (c.north);
\end{tikzpicture}
\caption{Text}
\label{fig:mysecondsubfig}
\end{subfigure}
\end{figure}
\end{document}
EDIT: Right now there are three problems: the two subfigures are not next to each other, the labels are missing and the subboxes for Text 2 and Text 4 are missing. Any ideas?
EDIT: Now the subfigures are next to each other. All I need right now are the subboxes and the labels.
