part 1 of making view for javascripty. More robust model design