refactored the simpleFirewall code to make it read more easily