small refactor on vertex