separate initialization logic from main method