Accept simple data structure as whole document
Accept number, boolean, null etc as top level data element
Clean up code