refactor vector patterns