Move initialized guard close to if condition