vector and rectangle class refactoring