Using cast instead of as