Refactor vector construction