test common code refactoring