refactoring: removin some casts