removed data processing out of template file - fixes #8