CLEREZZA-904 Removed invalid casts after code refactoring