Refactor a bit and add signatures/destination to logout