ticket:1 modify func and unit tests