Used a private function to simplify transform a bit