Exclude unwanted code with a class