vector functions cleanup and improvements