Formatting and rearranging code blocks