changed model to generic, now dynamic table build