fix a bug, refactor..