consolodating libraries

moving scattered code from old libraries into one place