refactored initialization method to use global variables for easier reading