Use static_cast instead of C style cast