remove unnecessary cast/conditional