Refactoring the code. Move components to separate files.
Refactoring jinja templates