Cleaned up templating. Fixed up parsing of data.