Refactor|Info: Applied a castTo<> template to avoid manual casting