Remove lines and rearrange the code block