[IMP] Moving some parts from template to layout to make them more modular

[IMP] Moving some parts from template to layout to make them more modular
@moylop260