move line cleaning to top of block