total refactor and improvement of casts CRUD