1. Moved xml to templates
2. Refactor code