more c5 frefactoring and added test cases