lunch time refactoring I did into dependent types