strict cast as one function