Refactoring for unit tests kitan