Refactor: Eliminate unnecessary cast