Improved business rule logic. Exctracted common setup of tests.