Refactoring and added an assembly tests