allow construction from a hash