refactor welcome page logic