Move line comment checks to a separate function.