try to refactor the code....