Add sign out feature.
Add some helpers and decoupling.
Some more decoupling.