Refactored initialization
created global variables