optimize casts :)