Automatically remove unused lines