Refactor done, add semi working login example.