add tests
Finish identity-handling