Moved reference variable to init function