Adding the test for assessing cancelled sub.
Minor code refactoring.

TNL-900