intelligently filter cases not to generate too much code
naive pretty printer