a lot of strange changes just to make it work with properties of any type