Refactoring initialization process