added as_hash method to get all fields with values as hash ref