Fixed unit tests failing after refactoring