some fixes and exhaustivity implementation
