split out core functionality

refs #29