refacting to suppress warnings