code refactor and additional doc tests
multi-value add refactor