MAGMA-237 Refactor  method to handle value sequences and make it more efficient.