Changed API to accept object

This gives more opportunities because you are not bound to a special
constructor