Improved cases implementation