fixed and refactor some test