beginning re factoring to make this more useful.