This file's logic was also ported and refactored into the Rule class