completely refactored the code to flatten vectors into consts values