Initial, extremely ugly, but working compilation of old and new approaches of cases formatter