first shot at generic framework