Re-factored code to remove rules declaration from the test into a rules engine construct.