remove unused code
add paintlines tree rule
disable restore button by default