First refactoring steps of post login process.