Updated initialization logic