genericising implementation

- handles arbitrary number of links
- pulls out all properties
- better error handling
- well tested