replace templates from file to dictionary