Change. remove some duplicate code.