this should be done from template