refactor and incorporate Vector