cleanup and slight commenting
made clean rule more dynamic