Refactored the vertex icon related code.