Move character and login logic into different files.