Added imports, template refactoring