Using alias for messages table make the query more flexible

Signed-off-by: emanuele <emanuele45@gmail.com>
Unused variable

Signed-off-by: emanuele <emanuele45@gmail.com>
Template layers may look good in a class with some priority parameter to better define the order

Signed-off-by: emanuele <emanuele45@gmail.com>
addBefore/After

Signed-off-by: emanuele <emanuele45@gmail.com>