Move logic to core class. Load the appropriate template