Fix the issue with multiple rules

Factor out the get method, so that the flow of execution is as follows:
1. Get the hosts lines
2. Apply all rules
3. Write the lines back to file