Some refactoring

- renamed some types to better match the API
- added type wrapper around links