use static_cast instead of C-style type casting