move lots of methods to Utils. add related specs.