initialization logic